<template>
	<view :style="themeColor">
		<view class="page">
			<view
				class="flex flex-direction flex-wrap align-stretch justify-center benben-position-layout flex report_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }"
			>
				<view class='flex flex-wrap align-stretch justify-between report_fd0_0'>
					<view
						class='flex flex-wrap align-center report_fd0_0_c0'
						@tap.stop="handleJumpDiy"
						data-type="back"
						data-url="1"
					>
						<text class='fu-iconfont2  report_fd0_0_c0_c0'>&#xe794;</text>
					</view>
					<view class='flex flex-wrap align-center'>
						<text
							class='report_fd0_0_c1_c0'
							style="font-family: Alimama DongFangDaKai, Alimama DongFangDaKai;"
						>举报</text>
					</view>
					<view class='flex align-center justify-end report_fd0_0_c2'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>

			<view
				class="loading_css"
				v-if="isShow"
			>
				<u-loading
					size="36"
					color="#AD3823"
				></u-loading>
				<view>加载中</view>
			</view>
			<block v-else>
				<!---意见反馈表单flex布局开始-->
				<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout">
					<view class='flex flex-direction align-stretch report_fd1_0'>
						<view
							class='flex flex-wrap align-center report_fd1_0_c0'
							style="font-family: Alimama DongFangDaKai;"
						>
							<text class='report_fd1_0_c0_c0'>请选择你想要举报的类型</text>
							<text class='report_fd1_0_c0_c1'>*</text>
						</view>
						<view
							class='flex flex-direction flex-wrap align-stretch report_fd1_0_c1'
							style="font-family: Alimama DongFangDaKai;"
						>
							<benben-select-diy
								ref="showSelectPopup1689675271268"
								class-name='flex flex-wrap align-center flex'
								:items.sync="changeType"
								v-model="changeId"
								default-type="id"
								default-label="title"
								:allow-cancel='false'
								type="radio"
								:disabled='false'
							>
								<template v-for='(item,key0) in changeType'>
									<view
										v-if="item.isSelected"
										class='flex align-center justify-center flex report_fd1_0_c1_c0_c0'
										:key="key0"
										@tap="$refs.showSelectPopup1689675271268.tapHandle(key0)"
									>
										<text class='flex-sub report_fd1_0_c1_c0_c0_c0'>{{item.title}}</text>
									</view>
									<view
										v-else
										class='flex align-center justify-center flex report_fd1_0_c1_c0_c1'
										:key="key0"
										@tap="$refs.showSelectPopup1689675271268.tapHandle(key0)"
									>
										<text class='flex-sub report_fd1_0_c1_c0_c1_c0'>{{item.title}}</text>
									</view>
								</template></benben-select-diy>
						</view>
						<view
							class='flex flex-wrap align-center report_fd1_0_c2'
							style="font-family: Alimama DongFangDaKai;"
						>
							<text class='report_fd1_0_c2_c0'>举报描述</text>
							<text class='report_fd1_0_c2_c0'>（选填）</text>
						</view>
						<view class='flex flex-direction flex-wrap align-stretch report_fd1_0_c3'>
							<view class='flex flex-wrap report_fd1_0_c3_c0'>
								<textarea
									class='flex report_input_fd1_0_c3_c0'
									confirm-type="done"
									:placeholder="'提供更多信息，有助于举报被快速处理～'"
									:maxlength="300"
									:show-num='true'
									placeholder-style="color:#999;font-size:28rpx"
									v-model="fd1_0_c3_c0"
								/>
								<template>
									<view class='flex flex justify-end report_numberfd1_0_c3_c0_c0'>
										<text>{{fd1_0_c3_c0.length}}</text>
										<text>/</text>
										<text>300</text>
									</view>
								</template>
							</view>
						</view>
						<view class='flex flex-direction align-stretch report_fd1_0_c4'>
							<benben-images-upload
								ref="benbenImagesUploadfd1_0_c4_c0"
								:img-list.sync="img"
								:img-ids.sync="img_id"
								:is-show-tips='true'
								:maxlength="3"
							>
								<template #content="{ num, maxlength, isShow, imgList }">
									<view class="flex flex-wrap align-start flex">

										<view
											v-for="(image, index) in imgList"
											:key="index"
											class='flex position-relative report_fd1_0_c4_c00'
										>
											<text
												class='fu-iconfont2 position-absolute report_fd1_0_c4_c000'
												@tap.stop="$refs.benbenImagesUploadfd1_0_c4_c0.delImage(index)"
											>&#xE8E7;</text>
											<image
												class='report_fd1_0_c4_c001'
												@tap.stop="$refs.benbenImagesUploadfd1_0_c4_c0.previewImage(index)"
												mode="aspectFill"
												:src='image'
											></image>
										</view>

										<image
											class='report_fd1_0_c4_c01'
											@tap.stop="$refs.benbenImagesUploadfd1_0_c4_c0.manyChooseImage()"
											v-if="isShow"
											mode="aspectFill"
											:src='STATIC_URL+"561.png"'
										></image>
										<text class='image_upload_tips report_fd1_0_c4_c02'>最多上传{{num}}/{{maxlength}}张图片 (选填)</text>
									</view>
								</template>
							</benben-images-upload>
						</view>
					</view>
					<!-- <button class='flex-sub report_fd1_1' open-type="contact">提交</button> -->
					<button
						class='flex-sub report_fd1_1'
						style="font-family: Alimama DongFangDaKai;"
						@tap.stop="submitReport"
					>提交</button>
				</view>

			</block>

		</view>
	</view>
</template>
<script>
	export default {
		components: {},


		data() {
			return {
				"fd1_0_c3_c0": "",
				"changeId": "",
				"changeType": [],
				"body": "",
				"img": [],
				"img_id": "",
				"id": "", // 心得id
				"isShow": true,
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			let { id } = options;
			if (id !== undefined) this.id = id;
			this.getReportType();
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			// 举报类型
			getReportType() {
				this.$api.post(global.API_VERSION + '6555714a487e9', {

				}).then(res => {
					this.isShow = false;
					if (res.data.code == 1) {
						this.changeType = res.data.data;
					} else {
						this.$message.info(res.data.msg);
					}
				})
			},
			submitReport() {
				if (!this.changeId) {
					this.$message.info('请选择举报类型');
					return;
				}
				this.$api.post(global.API_VERSION + '65557158857e7', {
					report_id: this.changeId,
					body: this.fd1_0_c3_c0,
					data_id: this.id,
					data_type: 1,
					thumb: this.img.length > 0 ? this.img.join(',') : ""
				}).then(res => {
					this.$message.info(res.data.msg);
					if (res.data.code == 1) {
						setTimeout(() => {
							uni.navigateBack();
						}, 800)
					}
				})
			},

		}
	};
</script>
<style
	lang="scss"
	scoped
>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: url(https://www.guochaoxiaoju.com/uploads/mini/480.png) no-repeat;
		background-size: 100% auto;
	}

	.report_flex_0 {
		border-bottom: 1px solid #eee;
		background: url(https://www.guochaoxiaoju.com/uploads/mini/480.png) no-repeat;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.report_fd0_0_c2 {
		padding: 0rpx 0rpx 0rpx 0rpx;
		width: 200rpx;
	}

	.report_fd0_0_c1_c0 {
		font-size: 40rpx;
		font-weight: 400;
		color: #000000;
		line-height: 50rpx;
	}

	.report_fd0_0_c0_c0 {
		font-size: 36rpx;
		font-weight: 400;
		color: #333;
	}

	.report_fd0_0_c0 {
		width: 200rpx;
	}

	.report_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		line-height: 88rpx;
	}

	.report_fd1_1 {
		background: var(--benbenbgColor2);
		border-radius: 44rpx 44rpx 44rpx 44rpx;
		font-size: 36rpx;
		color: var(--benbenFontColor3);
		height: 88rpx;
		line-height: 88rpx;
		width: 638rpx;
		position: fixed;
		left: 53rpx;
		bottom: calc(40rpx + var(--window-bottom));
	}

	.report_fd1_0_c4_c02 {
		font-size: 24rpx;
		color: #BFBFBF;
		font-weight: 400;
		margin: 20rpx 0rpx 0rpx 0rpx;
		width: 600rpx;
	}

	.report_fd1_0_c4_c01 {
		width: 164rpx;
		height: 164rpx;
		margin: 0rpx 24rpx 24rpx 0rpx;
	}

	.report_fd1_0_c4_c001 {
		width: 160rpx;
		height: 160rpx;
		border-radius: 16rpx;
	}

	.report_fd1_0_c4_c000 {
		top: 0rpx;
		right: 0rpx;
		z-index: 10;
		color: #ff5536;
	}

	.report_fd1_0_c4_c00 {
		margin: 0rpx 24rpx 24rpx 0rpx;
	}

	.report_fd1_0_c4 {
		padding: 32rpx 32rpx 0rpx 32rpx;
	}

	.report_numberfd1_0_c3_c0_c0 {
		width: 100%;
		font-size: 24rpx;
		color: rgba(153, 153, 153, 1);
		line-height: 46rpx;
		font-weight: 400;
	}

	.report_input_fd1_0_c3_c0 {
		width: 100%;
		height: 166rpx;
		font-size: 28rpx;
		font-weight: 400;
		color: var(--benbenFontColor0);
	}

	.report_fd1_0_c3_c0 {
		width: 686rpx;
		border-radius: 10rpx 10rpx 10rpx 10rpx;
		margin: 0rpx 0rpx 0rpx 32rpx;
		padding: 0rpx 0rpx 24rpx 0rpx;
	}

	.report_fd1_0_c3 {
		margin: 0rpx 0rpx 0rpx 0rpx;
	}

	.report_fd1_0_c2_c0 {
		font-size: 36rpx;
		font-weight: 400;
		color: #333333;
		line-height: 45rpx;
	}

	.report_fd1_0_c2 {
		padding: 32rpx 0rpx 32rpx 32rpx;
	}

	.report_fd1_0_c1_c0_c1_c0 {
		font-size: 28rpx;
		font-weight: 400;
		color: var(--benbenFontColor0);
		line-height: 62rpx;
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		text-align: center;
	}

	.report_fd1_0_c1_c0_c1 {
		background: #F7F6F4;
		margin: 16rpx 15rpx 16rpx 15rpx;
		height: 76rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		width: 192rpx;
		padding: 0rpx 10rpx 0rpx 10rpx;
	}

	.report_fd1_0_c1_c0_c0_c0 {
		font-size: 28rpx;
		font-weight: 400;
		color: var(--benbenFontColor3);
		line-height: 62rpx;
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		text-align: center;
	}

	.report_fd1_0_c1_c0_c0 {
		background: #AD3823;
		margin: 16rpx 15rpx 16rpx 15rpx;
		height: 76rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		width: 192rpx;
		padding: 0rpx 0rpx 0rpx 0rpx;
	}

	.report_fd1_0_c1 {
		border-bottom: 10px solid rgba(248, 248, 248, 1);
		padding: 0rpx 29rpx 16rpx 29rpx;
	}

	.report_fd1_0_c0_c1 {
		color: #AD3823;
		font-size: 40rpx;
		font-weight: 500;
	}

	.report_fd1_0_c0_c0 {
		font-size: 40rpx;
		font-weight: 500;
		color: var(--benbenFontColor0);
		margin: 0rpx 0rpx 0rpx 32rpx;
	}

	.report_fd1_0_c0 {
		padding: 32rpx 0rpx 12rpx 0rpx;
	}

	.report_fd1_0 {
		background: var(--benbenbgColor1);
		background-size: 100% auto !important;
		padding: 0rpx 0rpx 48rpx 0rpx;
		margin: 0rpx 0rpx 180rpx 0rpx;
	}
</style>